/**
 * Created by yuming619 on 2017/10/12.
 */
angular.module('service.cupboarlock', [
    "ngResource"
])
    .service('CupboarlockService', CupboarlockService);
CupboarlockService.$inject = ['$q','$resource'];
function CupboarlockService($q,$resource) {
    //开关锁服务
    this.updatestatus  = function(data,success,error){
        var resource = $resource(cupboardurl + 'devdoor');
        return resource.save({},data,success,error);
    };
    //查询锁状态
    this.getstatus = function (device,success,error){
        var resource = $resource(cupboardurl + 'devlock/:devid/:num');
        return resource.get({devid:device.devid,num:device.num},success,error);
    };
    //查询设备消息地址
    this.getInfo = function(id,success,error){
        var resource = $resource(cupboardurl + 'devshopinfo/:devid');
        return resource.get({devid:id},success,error);
    }
}